import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;


public class TestDB {

	/**
	 * @param args
	 * @throws ClassNotFoundException 
	 */
	public static void main(String[] args) throws Exception {
		Class.forName("com.mysql.jdbc.Driver");
		Connection con=DriverManager.getConnection("jdbc:mysql://10.5.20.16:58885/test?useUnicode=true&characterEncoding=UTF-8","ec_stat","L#c8UM5RGh5C");
		Statement stmt=con.createStatement();
		boolean issuccess=stmt.execute("use dbwww58com_groupbuy_stats;");
		System.out.println("show tables: "+issuccess);
//		ResultSet rs=stmt.getResultSet();
		ResultSet rs=stmt.executeQuery("show databases");
		while(rs.next()){
			System.out.println("results: "+rs.getString(1));
		}
	}

}
